package com.yswy.backstage.scheduled;


import com.yswy.backstage.serviceApi.ApiTgCallBackLoglService;
import com.yswy.common.utils.DateUtils;
import org.springframework.scheduling.annotation.Scheduled;

import java.util.Date;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@Async  //开启异步线程执行任务
@Slf4j
@Component
@EnableScheduling //标注启动定时任务
public class ScheduledService {
    @Autowired
    private ApiTgCallBackLoglService apiTgCallBackLoglService ;
    @Scheduled(cron = "0 */1 * * * ?")
    public void callBackAgreementOrder(){
        log.info("=====>>>>>延时执行签约回传:cron  {}", DateUtils.getNowDate(new Date()));
        apiTgCallBackLoglService.delayCallBack();
    }


}
